package com.gmail.mariska.martin.jpa.dao;

import java.util.Date;

import javax.persistence.EntityManager;

import com.gmail.mariska.martin.jpa.IDatinAble;

public class BussinesGenericDAO<T> extends GenericDAO<T> {

	public BussinesGenericDAO(Class<T> entityClass, EntityManager em) {
		super(entityClass, em);
	}

	@Override
	public void save(T entity) {
		if (entity instanceof IDatinAble) {
			((IDatinAble) entity).setDatin(new Date());
		}
		super.save(entity);
	}

}
